/*     */ package com.zimbra.cs.redolog.op;
/*     */ 
/*     */ import com.zimbra.common.calendar.ParsedDateTime;
/*     */ import com.zimbra.cs.mailbox.CalendarItem;
/*     */ import com.zimbra.cs.mailbox.Mailbox;
/*     */ import com.zimbra.cs.mailbox.MailboxManager;
/*     */ import com.zimbra.cs.mailbox.MailboxOperation;
/*     */ import com.zimbra.cs.mailbox.calendar.RecurId;
/*     */ import com.zimbra.cs.redolog.RedoLogInput;
/*     */ import com.zimbra.cs.redolog.RedoLogOutput;
/*     */ import java.io.IOException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class ModifyInvitePartStat
/*     */   extends RedoableOp
/*     */ {
/*  36 */   private int mCalItemId = 0;
/*  37 */   private String mRecurIdDt = null;
/*  38 */   private int mRecurIdRange = RecurId.RANGE_NONE;
/*  39 */   private String mCnStr = null;
/*  40 */   private String mAddressStr = null;
/*  41 */   private String mCUTypeStr = null;
/*  42 */   private String mRoleStr = null;
/*  43 */   private String mPartStatStr = null;
/*     */   private Boolean mRsvp;
/*     */   private int mSeqNo;
/*     */   private long mDtStamp;
/*     */   
/*     */   public ModifyInvitePartStat() {
/*  49 */     super(MailboxOperation.ModifyInvitePartStat);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public ModifyInvitePartStat(int mailboxId, int calItemId, RecurId recurId, String cnStr, String addressStr, String cutypeStr, String roleStr, String partStatStr, Boolean rsvp, int seqNo, long dtStamp)
/*     */   {
/*  56 */     this();
/*  57 */     setMailboxId(mailboxId);
/*     */     
/*  59 */     if (recurId != null) {
/*  60 */       this.mRecurIdDt = recurId.getDt().toString();
/*  61 */       this.mRecurIdRange = recurId.getRange();
/*     */     }
/*  63 */     this.mCnStr = (cnStr != null ? cnStr : "");
/*  64 */     this.mAddressStr = (addressStr != null ? addressStr : "");
/*  65 */     this.mCUTypeStr = (cutypeStr != null ? cutypeStr : "");
/*  66 */     this.mRoleStr = (roleStr != null ? roleStr : "");
/*  67 */     this.mPartStatStr = (partStatStr != null ? partStatStr : "");
/*  68 */     this.mRsvp = rsvp;
/*  69 */     this.mSeqNo = seqNo;
/*  70 */     this.mDtStamp = dtStamp;
/*     */   }
/*     */   
/*     */   public void redo() throws Exception {
/*  74 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/*  75 */     CalendarItem calItem = mbox.getCalendarItemById(null, this.mCalItemId);
/*  76 */     RecurId recurId = null;
/*  77 */     if (this.mRecurIdDt != null)
/*  78 */       recurId = new RecurId(ParsedDateTime.parse(this.mRecurIdDt, calItem.getTimeZoneMap()), this.mRecurIdRange);
/*  79 */     mbox.modifyPartStat(getOperationContext(), this.mCalItemId, recurId, this.mCnStr, this.mAddressStr, this.mCUTypeStr, this.mRoleStr, this.mPartStatStr, this.mRsvp, this.mSeqNo, this.mDtStamp);
/*     */   }
/*     */   
/*     */   protected String getPrintableData() {
/*  83 */     StringBuffer sb = new StringBuffer("calItemId=").append(this.mCalItemId);
/*  84 */     if (this.mRecurIdDt != null) {
/*  85 */       sb.append(", recurIdDt=").append(this.mRecurIdDt);
/*  86 */       sb.append(", recurIdRange=").append(this.mRecurIdRange);
/*     */     }
/*  88 */     sb.append(", cn=").append(this.mCnStr);
/*  89 */     sb.append(", address=").append(this.mAddressStr);
/*  90 */     sb.append(", cutype=").append(this.mCUTypeStr);
/*  91 */     sb.append(", role=").append(this.mRoleStr);
/*  92 */     sb.append(", part=").append(this.mPartStatStr);
/*  93 */     sb.append(", rsvp=").append(this.mRsvp);
/*  94 */     sb.append(", seqNo=").append(this.mSeqNo);
/*  95 */     sb.append(", dtStamp=").append(this.mDtStamp);
/*  96 */     return sb.toString();
/*     */   }
/*     */   
/*     */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 100 */     out.writeInt(this.mCalItemId);
/* 101 */     boolean hasRecurId = this.mRecurIdDt != null;
/* 102 */     out.writeBoolean(hasRecurId);
/* 103 */     if (hasRecurId) {
/* 104 */       out.writeInt(this.mRecurIdRange);
/* 105 */       out.writeUTF(this.mRecurIdDt);
/*     */     }
/*     */     
/* 108 */     out.writeUTF(this.mCnStr);
/* 109 */     out.writeUTF(this.mAddressStr);
/* 110 */     out.writeUTF(this.mCUTypeStr);
/* 111 */     out.writeUTF(this.mRoleStr);
/* 112 */     out.writeUTF(this.mPartStatStr);
/* 113 */     out.writeBoolean(this.mRsvp.booleanValue());
/* 114 */     out.writeInt(this.mSeqNo);
/* 115 */     out.writeLong(this.mDtStamp);
/*     */   }
/*     */   
/*     */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 119 */     this.mCalItemId = in.readInt();
/* 120 */     boolean hasRecurId = in.readBoolean();
/* 121 */     if (hasRecurId) {
/* 122 */       this.mRecurIdRange = in.readInt();
/* 123 */       this.mRecurIdDt = in.readUTF();
/*     */     }
/*     */     
/* 126 */     this.mCnStr = in.readUTF();
/* 127 */     this.mAddressStr = in.readUTF();
/* 128 */     this.mCUTypeStr = in.readUTF();
/* 129 */     this.mRoleStr = in.readUTF();
/* 130 */     this.mPartStatStr = in.readUTF();
/* 131 */     this.mRsvp = new Boolean(in.readBoolean());
/* 132 */     this.mSeqNo = in.readInt();
/* 133 */     this.mDtStamp = in.readLong();
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/ModifyInvitePartStat.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */